from ultralytics import YOLO



model = YOLO(r'D:\Desktop\Barcode\yolov8n.pt')

model.train(data=r'D:\Desktop\Barcode\ultralytics\cfg\datasets\coco8.yaml',
            epochs = 1,
            batch = -1,
            exist_ok = False,
            )